package cc.sunni.neti;

import java.util.concurrent.ThreadLocalRandom;

/**
 * @author jl
 * @since 2021/2/10 21:14
 * 模拟生成订单流水号
 */
public class Demo1 {

    public static String generateOrderNo(String type, String organizationId, String spgId, String date) {
        StringBuffer sb = new StringBuffer();
        sb.append(type);
        sb.append(organizationId);
        sb.append(spgId);
        sb.append(date);
        ThreadLocalRandom.current().ints(0, 9).limit(10).forEach(sb::append);
        return sb.toString();
    }

    public static void main(String[] args) {
        String orderNo = generateOrderNo("S", "000012", "11002", "20210210");
        System.out.println(orderNo);
    }
}
